home *** CD-ROM | disk | FTP | other *** search
- //
- // Gather AI file
- //
- // Behaviors:
- //
- // If given an order to gather, continue to do so until there are no more resources within
- // the visibility map and wander range.
- //
- // Notes:
- //
- // Known Problems:
- //
-
-
- AddResourceToStorage
- {
- StorageDestroyed true(FindNewStorage)
- ResourceCapacityEmpty true(CheckPreviousResource)
- }
-
- CheckForOpenPosition
- {
- WaitingAreaInRange false(MoveToWaitingArea)
- OpenPositionAvailable true(MoveToResource) false(WaitForOpenPosition)
- }
-
- CheckPreviousResource
- {
- ResourceDepleted true(FindNewResource) false(MoveToWaitingArea)
- }
-
- // assumption here is that there are no more waypoints
- CheckResourceAccessibility
- {
- ResourceAccessible true(GatherResource) false(FindNewResource)
- }
-
- CheckResourceCapacity
- {
- ResourceCapacityFilled true(FindStorage) false(FindNewResource)
- }
-
- CheckStorageAccessibility
- {
- StorageDestroyed true(FindNewStorage)
- StorageInRange true(AddResourceToStorage) false(FindNewStorage)
- }
-
- FindNewResource
- {
- NewResourceFound true(MoveToWaitingArea) false(FindStorage)
- }
-
- FindNewStorage
- {
- ResourceCapacityEmpty true(Idle)
- StorageFound true(MoveToStorage) false(Idle)
- }
-
- FindStorage
- {
- ResourceCapacityEmpty true(Idle)
- StorageFound true(MoveToStorage) false(Idle)
- }
-
- GatherResource
- {
- ResourceDepleted true(CheckResourceCapacity)
- ResourceCapacityFilled true(NotifyWaitingCitizen)
- ResourceInRange false(PrepareToMove)
- TakingLightDamage true(FleeDanger)
- }
-
- MoveToResource
- {
- ResourceInRange true(GatherResource) false(PrepareToMove)
- }
-
- MoveToWaitingArea
- {
- // resurrected gather goals put us here
- ResourceCapacityFilled true(MoveToStorage)
- ResourceTargetIsTree true(MoveToResource)
- WaitingAreaInRange true(CheckForOpenPosition) false(PrepareToMove)
- }
-
- MoveToStorage
- {
- StorageDestroyed true(FindNewStorage)
- StorageInRange true(AddResourceToStorage) false(PrepareToMove)
- }
-
- NotifyWaitingCitizen
- {
- StorageDestroyed true(FindNewStorage) false(FindStorage)
- }
-
- HasResourceGoal
- {
-
- ResourceTargetIsTree true(CheckResourceAccessibility)
- ResourceDepleted true(FindNewResource)
- ResourceInRange true(GatherResource) false(MoveToWaitingArea)
- }
-
- ReacquireGoal
- {
- GoalIsWaitingArea true(CheckForOpenPosition)
- GoalIsStorage true(CheckStorageAccessibility)
- GoalIsResource true(HasResourceGoal)
- }
-
-
- WaitForOpenPosition
- {
- ImAFarmer true(FindFarm)
- ResourceDepleted true(CheckResourceCapacity)
- WaitingAreaInRange false(MoveToWaitingArea)
- }
-
- FindFarm
- {
- FarmNotFound true(WaitForOpenPosition)
- }
-